<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>响应式数据</title>
    <script src="../../vue.js"></script>
</head>
<body>
<div id="box">
    <span>{{num}}</span>
    <input type="button" value="清除">
</div>

<script>
    var button1 = document.getElementsByTagName('input')[0]
    var data = {
        'num':1,
    }
    var vm = new Vue({
        el:'#box',
        data:data,
    })

    var dsq = setInterval(function () {
        data.num += 1;
    },1000)

    button1.onclick = function () {

        clearInterval(dsq);
    }


</script>

</body>
</html>